import { createStore } from 'vuex'

export default createStore({
  state: {
    // 数组储存时调用必传信息
    myget: {
      id: '',
      version: '',
      identityNumber: ''
    },
    // 是否被传参数params.id
    id: '',
    // 我的简历-基本信息
    myInfo: {
      realName: '', //姓名
      identityNumber: '', //证件号码
      workingYear: '', //工作年限
      sex: '', //性别
      highestEducation: '', //最高学历
      recruitment: '', //是否统招
      phoneNumber: '', //联系电话
      areaDetail: '', //居住详细地址
      liveArea: '' //居住区域
    },
    // 我的简历-求职意向
    resumeqz: {
      jobHuntStatus: '', //求职状态
      jobCategory: '', //工作性质
      wageLower: '', //工资上限
      wageUpper: '', //工资下限
      workPlace: '', //工作地点
      profession: '', //行业
    },
    // 求职意向-岗位code
    resumeIndustryInfoList: [],
    // 求职意向-岗位名称
    resumeName: [],
    // 求职意向-岗位临时数据
    data: [],
    // 我的简历-技能证书
    skillInfoList:{
      certificateName:'',//证书
      skillLevel:'',//等级
      getTime:'',//时间
    },
    certificateName:'',
    // 我的简历-语言能力
    language:{},
    // 教育经历
    educationInfo:{
      // graduateSchool:'',
      // profess:'',
      // schoolTime:'',
      // graduateTime:'',
      // recruitment:'',
      // education:''
    },
    educationList:[],
    // 所有的工作经历
    workList: [],
    // 当前修改工作经历
    workInfo:{},

    // 我的简历
    myjl: [],
    // 投递列表
    deliverlist: [{
      "time": "2022年6月9日",
      "list": [{
        "id": 1,
        "postId": 1534075429526798337,
        "companyName": "企业名称",
        "postName": "岗位名称",
        "educationalRequire": "中专/中技",
        "ageRequire": "20-50岁",
        "contactPerson": "刘阳",
        "contactPhoneNumber": "13752415001",
        "recruitNum": 5,
        "address": "岱山县秀山乡",
        "deliveryDate": "2022年6月9日",
        "postStatus": "审核中",
        "deliveryStatus": "已投递",
        "match": '非常匹配',
        'postSalary': '10k-12k',
        'industry': ['互联网+', '云服务', '企业安全'],
        'workExperience': '1~2年',
        'workExperienceLabel': '1~2年',
        'department': '产品设计部',
        'rest': '双休',
        'restLabel': '双休',
        'postType': '全职',
        'postTypeLabel': '全职',
        'nxin': '16薪'
      }]
    },{
      "time": "2022年6月5日",
      "list": [{
        "id": 5,
        "postId": 1534075429526798337,
        "companyName": "企业名称",
        "postName": "岗位名称",
        "educationalRequire": "中专/中技",
        "ageRequire": "20-50岁",
        "contactPerson": "刘阳",
        "contactPhoneNumber": "13752415001",
        "recruitNum": 5,
        "address": "岱山县秀山乡",
        "deliveryDate": "2022年6月5日",
        "postStatus": "审核中",
        "deliveryStatus": "已投递",
        "match": null,
        'postSalary': '10k-12k',
        'industry': ['互联网+', '云服务', '企业安全'],
        'workExperience': '1~2年',
        'workExperienceLabel': '1~2年',
        'department': '产品设计部',
        'rest': '双休',
        'restLabel': '双休',
        'postType': '全职',
        'postTypeLabel': '全职',
        'nxin': '16薪'
      },{
        "id": 6,
        "postId": 1534075429526798337,
        "companyName": "企业名称",
        "postName": "岗位名称",
        "educationalRequire": "中专/中技",
        "ageRequire": "20-50岁",
        "contactPerson": "刘阳",
        "contactPhoneNumber": "13752415001",
        "recruitNum": 5,
        "address": "岱山县秀山乡",
        "deliveryDate": "2022年6月5日",
        "postStatus": "审核中",
        "deliveryStatus": "已投递",
        "match": null,
        'postSalary': '10k-12k',
        'industry': ['互联网+', '云服务', '企业安全'],
        'workExperience': '1~2年',
        'workExperienceLabel': '1~2年',
        'department': '产品设计部',
        'rest': '双休',
        'restLabel': '双休',
        'postType': '全职',
        'postTypeLabel': '全职',
        'nxin': '16薪'
      }]
    }],
    // 身份证号
    token: '',
    // 加密身份证号
    idCard: ''
  },
  getters: {
    getmyjl:(state) => state.myjl,
    getdeliverlist: (state) => state.deliverlist,
    gettoken: (state) => state.token,
    getmyInfo: (state) => state.myInfo,
    getcertificateName: (state) => state.certificateName,
    getskillInfoList: (state) => state.skillInfoList,
    getlanguage: (state) => state.language,
    getselect: (state) => state.select,
    getresumeIndustryInfoList: (state) => state.resumeIndustryInfoList,
    getresumeName: (state) => state.resumeName,
    geteducationInfo: (state) => state.educationInfo,
    getworkInfo: (state) => state.workInfo,
    getdata: (state) => state.data,
    getresumeqz: (state) => state.resumeqz,
    getmyget: (state) => state.myget,
    getid: (state) => state.id,
    getworkList: (state) => state.workList,
    geteducationList: (state) => state.educationList,
    getidCard: (state) => state.idCard

  },
  mutations: {
    setmyjl(state, data) {
      state.myjl = data
    },
    setdeliverlist(state, data) {
      state.deliverlist = data;
    },
    settoken(state, data) {
      state.token = data;
    },
    setmyInfo(state, data) {
      state.myInfo = data;
    },
    setcertificateName(state, data) {
      state.certificateName = data;
    },
    setskillInfoList(state, data) {
      state.skillInfoList = data;
    },
    setlanguage(state, data) {
      state.language = data;
    },
    setresumeIndustryInfoList(state, data) {
      state.resumeIndustryInfoList = data;
    },
    setresumeName(state, data) {
      state.resumeName = data;
    },
    seteducationInfo(state, data) {
      state.educationInfo = data;
    },
    setworkInfo(state, data) {
      state.workInfo = data;
    },
    setdata(state, data) {
      state.data = data;
    },
    setresumeqz(state, data) {
      state.resumeqz = data;
    },
    setmyget(state, data) {
      state.myget = data;
    },
    setid(state, data) {
      state.id = data;
    },
    setworkList(state, data) {
      state.workList = data;
    },
    seteducationList(state, data){
      state.educationList = data;
    },
    setidCard(state, data) {
      state.idCard = data;
    }
  },
  actions: {
    acmyjl(context, myjl) {
      setTimeout(() => {
        context.commit('setmyjl', myjl)
      });
    },
    acdeliverlist(context, deliverlist) {
      setTimeout(() => {
        context.commit('deliverlist', deliverlist) 
      });
    },
    acdeliverlist(context, token) {
      setTimeout(() => {
        context.commit('token', token)
      });
    },
    acmyInfo(context, myInfo) {
      setTimeout(() => {
        context.commit('myInfo', myInfo)
      });
    },
    accertificateName(context, certificateName) {
      setTimeout(() => {
        context.commit('certificateName', certificateName)
      });
    },
    acskillInfoList(context, skillInfoList) {
      setTimeout(() => {
        context.commit('skillInfoList', skillInfoList)
      });
    },
    aclanguage(context, language) {
      setTimeout(() => {
        context.commit('language', language)
      });
    },
    aceducationInfo(context, educationInfo) {
      setTimeout(() => {
        context.commit('educationInfo', educationInfo)
      });
    },
    acworkInfo(context, workInfo) {
      setTimeout(() => {
        context.commit('workInfo', workInfo)
      });
    }
  },
  modules: {
  }
})
